package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.Permission;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

public interface PermissionDao {

    @Select("select * from t_permission p,t_role_permission rp where rp.role_id = #{id} and rp.permission_id = p.id")
    List<Permission> findByRids(Integer roleId);

    Set<Permission> findByRoleId(Integer roleId);

    void add(Permission permission);

    Page<Permission> selectByCondition(String queryString);

    void deleteById(Integer id);

    long findCountByPermissionId(Integer id);

    Permission findById(Integer id);

    void edit(Permission permission);

    List<Permission> findAll();


}
